//封装网络请求
import axios from "../utils/request";
import {baseUrl} from "@/config/api/global";

const request = {
    //登录账户
    login(param) {
        return axios.post("/front/adminLogin", param)
    },
    //退出登录
    logout() {
        return axios.get("/front/user/logout")
    },
    //上传用户头像
    uploadUserHeader(param){
        return axios({
            url:"/userInformation/uploadImage/heard",
            method:"post",
            data:param,
            headers:{
                'Content-Type':'multipart/form-data'
            }
        })
    },
    //获取登录验证码
    loginCaptcha() {
        return axios.get("/front/captcha")
    },
    // 删除验证码
    deleteCaptcha(param) {
        return axios.get("/front/delete/captcha/" + param)
    },
    //分页条件获取用户信息
    selectLimitUserCondition(param) {
        return axios.post("/userInformation/admin/getUserAll/condition", param)
    },

    //分页条件获取全部文章信息
    selectLimitInformationAdmin(param) {
        return axios.post("/writings/selectLimitAdmin", param);
    },

    //更新用户信息
    updateUserInfo(param) {
        return axios.post("/userInformation/updateAdmin", param)
    },
    //更新文章信息
    updateWritingsInfo(param) {
        return axios.post("/writings/updateAdmin", param)
    },
    //获取所有操作日志
    getAllLogs(param) {
        return axios.post("/operationalLogs/getAll", param)
    },

    //删除操作日志
    deleteLogs(param) {
        return axios.delete("/operationalLogs/deleteAdmin/" + param)
    },

    //更新网站配置
    uploadAdminWebImg(param) {
        return axios({
            url:"/websiteAdministration/uploadImage",
            method:"post",
            data:param,
            headers: {
                'Content-Type': 'multipart/form-data'
            },
        })
    },

    //更新内容
    updateAdminWeb(param) {
        return axios.post("/websiteAdministration/update", param)
    },
    //获取内容
    getAdminWeb() {
        return axios.get("/websiteAdministration/getAll")
    },
    //获取公告内容
    getAdminAnnouncement(param) {
        return axios.post("/announcement/getAll", param)
    },
    //新增公告内容
    insertAdminAnnouncement(param) {
        return axios.post("/announcement/insert", param)
    },
    //删除公告内容
    deleteAdminAnnouncement(param) {
        return axios.post("/announcement/delete", param)
    },
    //获取留言内容
    getAdminMessageBoards(param) {
        return axios.post("/message/getAll/admin", param)
    },
    //删除留言内容
    delAdminMessageBoards(param) {
        return axios.post("/message/delete/admin", param)
    },
    //单独获取公告内容
    getAnnouncement(param) {
        return axios.get("/announcement/getAllAnnouncement/" + param)
    },

    //查询琐事内容
    getTrivia(param) {
        return axios.post("/trivia/getAllAdmin", param)
    },

    //更新琐事
    updateTrivia(param) {
        return axios({
            url:"/trivia/update",
            method:"post",
            data:param,
            headers: {
                'Content-Type': 'multipart/form-data'
            },
        })
    },
    //新增琐事
    insertTrivia(param) {
        return axios({
            url:"/trivia/insert",
            method:"post",
            data:param,
            headers: {
                'Content-Type':'multipart/form-data'
            },
        })
    },
    //删除琐事
    delTrivia(param) {
        return axios.post("/trivia/del",param)
    },
    //分页获取祝福评论
    getAdminLove(param) {
        return axios.post("/love/getAll/admin", param)
    },
    //删除祝福评论
    delAdminLove(param) {
        return axios.delete("/love/delete/" + param)
    },
    //分页获取恋爱事项
    getAdminLoveList(param) {
        return axios.post("/loveList/getAll/admin", param)
    },

    //变更恋爱事项状态
    updateAdminLoveListStatue(param) {
        return axios.post("/loveList/updateStatue", param)
    },
    //新增恋爱事项
    insertAdminLoveList(param) {
        return axios({
            url:"/loveList/add",
            method:"post",
            data:param,
            headers: {
                'Content-Type':'multipart/form-data'
            },
        })
    },
    //删除恋爱事项
    delAdminLoveList(param) {
        return axios.post("/loveList/delete", param)
    },
    //获取所有管理员信息
    getAdmin(param) {
        return axios.post("/userInformation/getAll/admin", param)
    },
    //新增管理员
    insertAdmin(param) {
        return axios({
            url:'/userInformation/supperAdmin/insert',
            method:'post',
            data:param,
            headers:{
                'Content-Type':'multipart/form-data'
            }
        })
    },

    //获取当日登录用户总数
    userLogin() {
        return axios.get("/userInformation/userLogin/day")
    },

    //获取所有用户总数
    getUserLength() {
        return axios.get("/userInformation/getAll/length")
    },

    //获取文章总数
    writingsNum() {
        return axios.get("/writings/length")
    },

    //获取网站访问总次数
    webLength() {
        return axios.get("/websiteAdministration/length")
    },

    //获取网站未审核文章
    writingsState() {
        return axios.get("/writings/writingsState")
    },

    //更改Admin基本信息
    AdminInfo(param) {
        return axios.post("/userInformation/AdminInfo", param)
    },
    //Admin分页获取全部图片类型
    pictureTypeAdmin(param) {
        return axios.post("/picture/getAll/admin", param)
    },
    //更新精美图片
    uploadPicture(param) {
        return axios({
            url:"/picture/update",
            method:"post",
            data:param,
            headers: {
                'Content-Type':'multipart/form-data'
            },
        })
    },
    //删除精选图片
    pictureDelete(param) {
        return axios.post("/picture/delete",param)
    },
    //新增精选图片
    pictureInsert(param) {
        return axios({
            url:"/picture/insert/into",
            method:"post",
            data:param,
            headers: {
                'Content-Type':'multipart/form-data'
            },
        })
    },
    //删除文章
    writingsDel(param){
        return axios.post("/writings/admin/writingsDel",param);
    },
    //删除用户信息
    userDel(param){
        return axios.delete("/userInformation/deleteAdmin/"+param)
    },

    //获取近七日流量记录
    changelogServer(){
        return axios.get("/changelogServer/getSeven")
    },
    //查询评论
    selectComments(param){
        return axios.post("/comments/admin/select",param)
    },
    //批量删除评论
    delAllComments(param){
        return axios.post("/comments/admin/delAll",param)
    },
    //删除单个评论
    delComments(param){
        return axios.delete("/comments/admin/del/"+param)
    }



}

export default request;